//
//  ZLLandingViewController.m
//  8.18项目
//
//  Created by ma c on 16/8/18.
//  Copyright © 2016年 zhang. All rights reserved.
//

#import "SXTLandingViewController.h"
#import "SXTLandingInPutView.h"//输入账户,密码
#import "SXTThirdLandingView.h"//第三方登录
#import "SXTLandingNextViewController.h"//下一步viewController



@interface SXTLandingViewController ()

@property (nonatomic,strong) SXTLandingInPutView * landingInPutView;//输入
@property (nonatomic,strong) SXTThirdLandingView * thirdView;

@end

@implementation SXTLandingViewController

-(SXTLandingInPutView *)landingInPutView{

    if (!_landingInPutView) {
        _landingInPutView = [[SXTLandingInPutView alloc]init];
        
        __weak typeof(self) weakSelf = self;
        _landingInPutView.nextBlock = ^(NSDictionary *userDic){
            SXTLandingNextViewController *nextViewController = [[SXTLandingNextViewController alloc]init];
            nextViewController.userDic = userDic;
            [weakSelf.navigationController pushViewController:nextViewController animated:YES];
        };
    }
    return _landingInPutView;
}
-(SXTThirdLandingView *)thirdView{

    if (!_thirdView) {
        _thirdView = [[SXTThirdLandingView alloc]init];
    }
    return _thirdView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    self.title = @"注册";
    [self addAutoLayout];
}

- (void)addAutoLayout {

    [self.view addSubview:self.landingInPutView];
    [self.view addSubview:self.thirdView];
    
    __weak typeof(self) weakSelf = self;
    [_landingInPutView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(weakSelf.view);
        make.height.equalTo(@210);
    }];
    
    [_thirdView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(weakSelf.view);
        make.top.equalTo(weakSelf.landingInPutView.mas_bottom).offset(10);
        make.height.equalTo(@80);
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
